import request from '@/util/request'

export function addWord(word) {
  return request({
    url: '/word/add',
    method: 'post',
    data: word
  })
}

export function adminAddWord(word) {
  return request({
    url: '/admin/word/add',
    method: 'post',
    data: word
  })
}

export function updateWord(word) {
  return request({
    url: '/word/update',
    method: 'post',
    data: word
  })
}

export function adminUpdateWord(word) {
  return request({
    url: '/admin/word/update',
    method: 'post',
    data: word
  })
}

export function getBookWord(wordBo) {
  return request({
    url: '/word/list-book-word',
    method: 'post',
    data: wordBo!=null?wordBo:{}
  })
}

export function getDefaultBookWord(wordBo) {
  return request({
    url: '/word/default/list-book-word',
    method: 'post',
    data: wordBo!=null?wordBo:{}
  })
}

export function getDefaultWord(wordBo) {
  return request({
    url: '/word/default/list-word',
    method: 'post',
    data: wordBo!=null?wordBo:{}
  })
}

export function getAdminPresetWord(wordBo) {
  return request({
    url: '/admin/word/list',
    method: 'post',
    data: wordBo!=null?wordBo:{}
  })
}

export function getWordDetail(wordBo) {
  return request({
    url: '/word/detail',
    method: 'post',
    data: wordBo!=null?wordBo:{}
  })
}

export function getDefaultWordDetail(wordBo) {
  return request({
    url: '/word/default/detail',
    method: 'post',
    data: wordBo!=null?wordBo:{}
  })
}

export function refreshWord(wordId) {
  return request({
    url: '/search/refresh?wordId='+wordId,
    method: 'get',
  })
}

export function adminDeletePresetWord(wordList) {
  return request({
    url: '/admin/word/delete',
    method: 'post',
    params:wordList
  })
}